package cn.com.connected.controller;

import cn.com.connected.base.params.page.BaseSearchDto;
import cn.com.connected.base.params.page.PageResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import cn.com.connected.vo.SysPublicVo;
import cn.com.connected.dto.search.SysPublicSearchDto;
import cn.com.connected.service.SysPublicService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;


/**
 * 公告
 * @author sms
 * @email sms@live.com
 * @date 2022-10-31 14:09:14
 */
@Api(tags = "公告")
@RestController
@Slf4j
public class SysPublicController extends BaseController  {

    @Resource
    private SysPublicService sysPublicService;

    @ApiOperation(value="描述:公告详情 ok")
    @RequestMapping(value="/v1/sys-public/{id}",method= RequestMethod.GET)
    public SysPublicVo sysPublicInfo(@PathVariable("id") String id) {
        return sysPublicService.sysPublicInfo(id);
    }

    @ApiOperation(value="描述:公告列表 ok")
    @RequestMapping(value="/v1/sys-publics",method= RequestMethod.POST)
    public PageResult<SysPublicVo> sysPublics(@RequestBody BaseSearchDto<SysPublicSearchDto> searchParams) {

        return sysPublicService.sysPublicPage(searchParams);
    }

}
